
package se.sll.service.catalogue.gui.api.resource;

import java.util.List;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import se.sll.service.catalogue.gui.api.model.RoleInfoList;
import se.sll.service.catalogue.gui.api.support.ResponseWrapper;


/**
 * Handles information of different user roles
 * 
 */
@Path("roles")
public interface RolesService {


    /**
     * Reads the current availible user roles.
     * 
     */
    @GET
    @Produces({
        "application/json"
    })
    RolesService.GetRolesResponse getRoles()
        throws Exception
    ;

    public class GetRolesResponse
        extends ResponseWrapper
    {


        private GetRolesResponse(Response delegate) {
            super(delegate);
        }

        /**
         * The requested Role was found and is returned in the body. e.g. [
         *   {"role":"SUPERADMIN"},
         *   {"role":"CAREUNITADMIN"},
         *   {"role":"CAPACITYADMIN"}
         * ]
         * 
         * 
         * @param entity
         *     [
         *       {"role":"SUPERADMIN"},
         *       {"role":"CAREUNITADMIN"},
         *       {"role":"CAPACITYADMIN"}
         *     ]
         *     
         */
        public static RolesService.GetRolesResponse jsonOK(List<RoleInfoList> entity) {
            Response.ResponseBuilder responseBuilder = Response.status(200).header("Content-Type", "application/json");
            responseBuilder.entity(entity);
            return new RolesService.GetRolesResponse(responseBuilder.build());
        }

    }

}
